var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
    })(t, e);
}, function(t, e) {
    function i() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, 
    new i());
}), a = this && this.__decorate || function(t, e, i, o) {
    var n, c = arguments.length, r = c < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; 0 <= s; s--) (n = t[s]) && (r = (c < 3 ? n(r) : 3 < c ? n(e, i, r) : n(e, i)) || r);
    return 3 < c && r && Object.defineProperty(e, i, r), r;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = cc._decorator, s = r.ccclass, c = r.property, l = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.box_sprite = null, t.width = 0, t.height = 0, t;
    }
    return i(t, e), t.prototype.onLoad = function() {
        var t = cc.view.getCanvasSize();
        t.width / t.height < 1.7 ? (cc.Canvas.instance.fitWidth = !0, cc.Canvas.instance.fitHeight = !1) : (cc.Canvas.instance.fitWidth = !1, 
        cc.Canvas.instance.fitHeight = !0), this.node.setContentSize(cc.winSize), this.width = this.box_sprite.node.width, 
        this.height = this.box_sprite.node.height, this.box_sprite.node.setContentSize((Math.ceil(cc.winSize.width / this.width) + 4) * this.width, (Math.ceil(cc.winSize.height / this.height) + 4) * this.height);
    }, t.prototype.start = function() {
        var t = this;
        cc.tween(this.box_sprite.node).repeatForever(cc.tween().by(12, {
            position: cc.v2(this.width, this.height)
        }).call(function() {
            t.box_sprite.node.setPosition(cc.Vec2.ZERO);
        })).start();
    }, a([ c(cc.Sprite) ], t.prototype, "box_sprite", void 0), a([ s ], t);
}(cc.Component);

n.default = l;